package com.xr.miniprogram.controller.agreement;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xr.common.annotation.Log;
import com.xr.common.core.controller.BaseController;
import com.xr.common.core.domain.AjaxResult;
import com.xr.common.enums.BusinessType;
import com.xr.miniprogram.domain.MiniProgramAgreement;
import com.xr.miniprogram.service.IMiniProgramAgreementService;
import com.xr.common.utils.poi.ExcelUtil;
import com.xr.common.core.page.TableDataInfo;

/**
 * 协议Controller
 * 
 * @author wls
 * @date 2023-12-15
 */
@RestController
@RequestMapping("/miniprogram/agreement")
public class MiniProgramAgreementController extends BaseController
{
    @Autowired
    private IMiniProgramAgreementService miniProgramAgreementService;

    /**
     * 查询协议列表
     */
    @GetMapping("/list")
    public TableDataInfo list(MiniProgramAgreement miniProgramAgreement)
    {
        startPage();
        List<MiniProgramAgreement> list = miniProgramAgreementService.selectAgreementList(miniProgramAgreement);
        return getDataTable(list);
    }

    /**
     * 获取协议详细信息
     */
    @GetMapping(value = "/{agreementId}")
    public AjaxResult getInfo(@PathVariable("agreementId") Long agreementId)
    {
        return success(miniProgramAgreementService.selectAgreementById(agreementId));
    }
}
